package com.xiaoq.shop.entity;

/**
 * @author xinpeng created on 16/9/21-下午6:35.
 */
public enum OrderState {


    FAILEDPLACED(-1),  //下单失败
    PLACEDORDER(1),    //已下单,提交订单时,首先值为此状态（此状态对用户不可见）,OrderService接收到消息中间件的"库存扣减成功"后,将状态改为"下单成功"
    SUCCESSFULPLACED(2),   //下单成功
    CONFIRMED(3),      //已确认,未来可能会增加店主确认订单的环节,目前没用
    TODELIVERY(4),     //待发货
    DELIVERIED(5),     //已发货
    TORECEIVE(6),      //待收货
    TOREVIEW(7),       //待评论
    COMPLETED(8),      //已正常完成
    CANCELED(9),      //已取消
    CLOSED(10),        //非正常完成的订单关闭
    ALL(99);           //所有订单状态


    private int code;

    OrderState(int code){
        this.code = code;
    }

    public int value(){
        return this.code;
    }
}
